package com.zmy.xcx.project.controller;

import com.zmy.xcx.project.common.convention.result.Result;
import com.zmy.xcx.project.common.convention.result.Results;
import com.zmy.xcx.project.dao.entity.Patient;
import com.zmy.xcx.project.dao.entity.TreatmentMethod;
import com.zmy.xcx.project.service.TreatmentMethodService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 病人控制层
 */
@RestController
@RequiredArgsConstructor
public class TreatmentMethodController {

    private final TreatmentMethodService treatmentMethodService;

    /**
     * 根据治疗方法id获取治疗方法类
     * @param id
     * @return TreatmentMethod
     */
    @GetMapping ("/TreatmentMethod/{id}")
    public Result<TreatmentMethod> getTreatmentMethod(@PathVariable("id") String id){
        return Results.success(treatmentMethodService.getTreatmentMethod(id));
    }
}
